<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath(); 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+path+ "/"; 
%>
<!DOCTYPE HTML>
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title>添加银行卡成功短信内容</title>
	<link rel="stylesheet" href="plugin/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/bootstrap-datetimepicker.css" />
    <link rel="stylesheet" href="plugin/bootstrap-table/dist/bootstrap-table.css">
<style type="text/css">
 
  .addbr{
     float: right;
    margin-right: 80px;
  }
  .pad{
    padding-left:15px;
    padding-top:10px;
  }
  .im{
     padding:10px;
  }
  .padtr{
      margin-top:5px;
  }
  #filediv{
  border: 2px solid #ccc6c6;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    display: inline-block;
    margin-right: 20px;
  }
.glyphicon-plus:before{
    color: #CCC;
}
.btn1{
    margin-top: 10px;
}
</style>

</head>
<body>
    <div class="row base-margin" id="query">
        <ul class="breadcrumb">
       
				<li style="padding-left: 15px"><i class="icon-home home-icon"></i> <a href="javascript:void(0)">System Settings(系统设置)</a>
				</li>
				<li class="active">
				<a href="view/sys/charging_time.jsp">Add bank card successful text message(添加银行卡成功短信内容)</a></li>
        </ul>
        <form class="form-horizontal" style="margin-left: 82px;" role="form"  method="post" id="queryForm">
           
           <div class="form-group">
                <label for="bName">Message content(短信内容):</label> 
                   <textarea rows="20" cols="20" id="add_card_message"></textarea>
                <input type="hidden" id="ids" />
            </div>  
            <div class="form-group" style="margin-left:40px">
                <button  onclick="save()" class="btn btn-info"style="width: 200px">Save(保存)</button>
            </div> 
        </form>
    </div>
</body>

	<!-- 加载需要的js -->
	<script src="js/jquery-3.2.1.min.js"></script>
	<script src="plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script src="js/jquery-bootstrap-pagination.js"></script>
	<script src="plugin/bootstrap-table/dist/bootstrap-table.min.js"></script>
	<script src="plugin/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
	<script src="js/common.js"></script>
	<script src="plugin/layer/layer.js"></script>
	<script type="text/javascript" charset="utf-8">
	$(function () {
		initData();
	});
	
	function cacel(){
		layer.closeAll();
	}
	function initData(){
		 $.ajax({
             type: "get",
             url: "configManager/getList",
             success: function(data){    	            	 
            if(data.code==200){
          	 $('#ids').val(data.data[0].id);
          	 $('#add_card_message').val(data.data[0].add_card_message);
      	       }else{
      	    	    layer.msg(data.msg);
      	       }
                      }
         });
	}
			//保存
	 function save(){
		var id =$('#ids').val();
		var add_card_message=$('#add_card_message').val();
		if(add_card_message==""){
			 layer.msg("Text messages cannot be empty.");
			 return;
		}
        var data={"id":id,"add_card_message":add_card_message};
      		 $.ajax({
                   type: "post",
                   url: "configManager/addOrUpdate",
                   data: JSON.stringify(data),
                   contentType:"application/json;charset=UTF-8", 
                   dataType:"json",
                   success: function(data){    	            	 
                  if(data.code==200){
                	  window.location.reload();
            	       }else{
            	    	    layer.msg(data.msg);
            	       }
                            }
               }); 
		 
	} 
	
	
	 
	</script>
</html>


